package com.example.tic_tac_toe_in_android.view;

import com.example.tic_tac_toe_in_android.R;
import com.example.tic_tac_toe_in_android.R.layout;
import com.example.tic_tac_toe_in_android.R.menu;

import android.os.Bundle;
import android.os.Handler;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;

public class SplashScreenActivity extends Activity implements Runnable {

	private static Handler handler = new Handler();

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_splash_screen);

		if (savedInstanceState == null) {
			handler.postDelayed(this, 3000);
		}

	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_splash_screen, menu);
		return true;
	}

	public void run() {
		Intent intent = new Intent(this, MainActivity.class);
		startActivity(intent);
		finish(); // Luk velkomsaktiviteten
	}

}
